# coding=utf-8
import tkinter;
import tkinter.messagebox;

def Refresh():
    FILE = str(NameEntry.get());
    Kc = open(FILE , "rb");
    SIZE = len(Kc.read());
    print(SIZE);
    tkinter.messagebox.showinfo("监视器",str(SIZE)+"字节");

if (__name__ == "__main__"):
    root = tkinter.Tk("文件大小监视器");
    root.geometry("300x300");
    NameLabel = tkinter.Label(text = "文件名:");
    NameEntry = tkinter.Entry(bd = 3);
    NameLabel.pack(side=tkinter.TOP);
    NameEntry.pack(side=tkinter.TOP);
    refreshButton=tkinter.Button(text = "更新" , command = Refresh);
    refreshButton.pack(side=tkinter.TOP);
    root.mainloop();
